Skip to content

fix(ci): honor the dry_run input in the weekly-digest workflow - #15

Merged
abrichr merged 2 commits into
mainfrom
fix/ledger-2026-10-10
Oct 14, 2026
Merged

abrichr merged 2 commits into
mainfrom
fix/ledger-2026-10-10

Conversation

@abrichr

@abrichr abrichr commented Oct 10, 2026

Copy link
Copy Markdown
Member

Running the weekly-digest workflow by hand with Dry run (preview only) selected still posted to Discord, and to X and LinkedIn when those secrets were set. The workflow compared the boolean dry_run input with the string 'true', which GitHub Actions always evaluates as false, so herald publish never got --dry-run. The workflow now uses the boolean directly and also sets HERALD_DRY_RUN, so a dry run stays preview-only.

Fixes

Problem Change Regression test Ref
A manual run of the weekly-digest workflow with Dry run (preview only) selected posted for real. The publish step used inputs.dry_run == 'true'. For a type: boolean input, inputs.dry_run is a boolean, and GitHub Actions converts both sides of that comparison to numbers (true is 1, 'true' is NaN), so the result was always false and --dry-run was never passed. .github/workflows/release-announce.yml passes ${{ inputs.dry_run && '--dry-run' || '' }} and sets HERALD_DRY_RUN from the same input, so the CLI's own setting also enforces the dry run. Scheduled runs have no inputs, so they get no flag and HERALD_DRY_RUN=false, and still post the weekly digest. tests/test_workflows.py: test_boolean_inputs_are_not_compared_with_strings, test_publish_step_passes_dry_run_to_herald. Two more tests, test_release_announce_declares_dry_run_as_boolean and test_string_comparison_check_covers_every_expression_form, make sure the check still finds boolean inputs and every comparison form, including bare if: conditions. B249

Not fixed here

  • Other weekly-digest problems remain: the release collector's gh api query fails, so digests and release posts include no releases; X and LinkedIn posts are cut mid-word at the length limit; the README install command names a package that isn't on PyPI; and re-running after a partial failure posts again on platforms that already succeeded. These are scheduled after feat: add herald post to post approved text to X verbatim #14 merges, because feat: add herald post to post approved text to X verbatim #14 also changes the README and how herald posts to X. (B250)
  • The publish step still sets the Discord embed title to "Weekly Digest" for release and spotlight runs.
  • The weekly-digest workflow is still disabled for inactivity, and this change doesn't re-enable it. Fix the release collector before you re-enable it, or the digest will post without any releases.

How it was tested

  • test_boolean_inputs_are_not_compared_with_strings[release-announce.yml] and test_publish_step_passes_dry_run_to_herald fail on main and pass on this branch.

  • Both expressions were evaluated with GitHub's @actions/expressions evaluator (0.3.61):

    inputs.dry_run Old flag New flag New HERALD_DRY_RUN
    true (empty) --dry-run true
    false (empty) (empty) false
    Not set (scheduled run) (empty) (empty) false

    If the input ever arrived as the string 'false' instead of a boolean, the new expression would add --dry-run, so the failure mode is a skipped post, not an unintended one.

  • Full suite: 81 passed on Python 3.12. The workflow tests also pass on Python 3.10. ruff check . passes, and uv build builds the sdist and wheel.

  • actionlint reports nothing on the changed lines. Its four SC2086 shellcheck notes on the "Determine content type" step are also on main. actionlint doesn't catch the original comparison, so the new test is what guards against it.

🤖 Generated with Claude Code

abrichr and others added 2 commits October 10, 2026 00:11
The workflow_dispatch input `dry_run` is declared `type: boolean`, so
`inputs.dry_run` is a real boolean. The publish step compared it with the
string 'true'. GitHub's expression engine converts both sides to numbers for
that comparison (true is 1, 'true' is NaN), so it was always false. A manual
run with "Dry run (preview only)" checked ran `herald publish` without
`--dry-run` and posted to Discord, and to X and LinkedIn when those secrets
are set.

Pass the flag from the boolean directly, and also set HERALD_DRY_RUN from it
so the CLI's own setting enforces the dry run if the flag is ever lost.
Scheduled runs have no inputs, so they still post the weekly digest.

Add tests/test_workflows.py, which fails if any workflow compares a boolean
input with a quoted string, and checks that the publish step passes dry run
to herald both ways.

Ledger: B249

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
GitHub evaluates an `if:` value as an expression even without `${{ }}`
around it, so `if: inputs.dry_run == 'true'` has the same always-false
bug. The workflow check only scanned `${{ }}` blocks and missed it.

Scan bare `if:` values too, and add a test that runs the finder on an
inline workflow with each comparison form, so the check cannot silently
stop detecting them.

Ledger: B249

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
@abrichr
abrichr merged commit 0d4531c into main Oct 14, 2026
3 checks passed
@abrichr
abrichr deleted the fix/ledger-2026-10-10 branch October 14, 2026 06:29
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant